small refactoring and cleanup in controller interpreter