Slight refactor, split the lexer in two and changes to common.