splitting out lexing, parsing, rendering and public functions into different files