separate controller logic