clean up, got rid of some duplication