Refactoring, added time to checks.