remove duplicated code and change Time.now to Time.now.utc