Clean up ns declarations, more idiomatic code
Merge pull request #212 from danielcompton/clean-up

Clean up ns declarations, more idiomatic code