Rmoved some unnecessary code