Remove unneccesary attributes and speed up if statement