Clean up time calculation