cleaned up some code again