refactored install controller code.