Improved lexer to open files in background