Refactor yylex func