Factor out into smaller methods

Still a bit of a dog's breakfast, though
Let's try Coveralls again
Merge pull request #35 from pikesley/refactor-because-complex

Factor out into smaller methods