Refactor controller loader