Code Cleanups

This commit reduced unnecessary or's and an expensive loop