tried to clean up code and concept