refactored to remove a lot of the static methods, general cleanup