clean up and efficiency fixes

should be nicer now