Remove conditional logic from the parser and move it to its own class, that way any improvements or conditional features will make cleaner changes. Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>