Refactored Time calculation in Home Controller