simplified some more code