Added time everywhere. Moved all state to application.