Implemented controller logic