Move compiling to separate class