Move helper functions into separate file
Extract compilers into separate functions