fixed reading test by adding setup code and refactoring in er.rb
refactored find method extensively for clarity using enums
moving methods into private declaration