clean up and simplifiy