Moved 'code' code to JS instead of new controller'