refactor to reduce memory and safer initialize for @attributes
better to_b for string
Merge pull request #2 from JoshMcKin/refactor

Refactor