refactored TimeContract