creating controllers and optimizing using MVC model