Some cleanup. removed superfluous null checks