refactoring and improving some of the lexer combinator templates