controller seperated and removed from global scope