refactoring...
Merge pull request #175 from joh641/refactor/valid_res

refactoring...