Added some utility methods and cleaned up a bit.