refactoring setValues to bind and other minors.