Refactor component controller