reduced some unnecessary code