reorder methods and cleanup a little