collapse method to 1 line
fix spec. returned value is Hash not OpenStruct as originally planned
refactor some methods for clarity