[#36] Refactored controller to make more use of cached variable