removing lots of unnecessary code