Refactored controller and view for power calculation