Added some new helpers
Cleaned up some code.