Improve structuring of controller