cleaning up code some