Refining controller logic