Changed time definition, refactoring, documentation