Removal of some unnecessary pointers and if statements