Refactored controllers

Made controllers mockable