cleanup and added helper methods