Added validation, partials, and refactored.