Moved a local method to before the task calling it.
Added :valid? method for Repo.