refactor view code to use helper methods corrected state field
adds validations
resolves merge conflicts