managed input in interpreter + minor refactoring to compiler