Transferred pause and sleep task to main class