Removed inefficient code