refactoring factory and controllers - part2