More refactoring
Merge pull request #2 from lukecampbell/bs

More refactoring