Added some utility methods prior to refactoring. Changed bitwise ANDs to boolean ANDs.

Signed-off-by: John May <john.wilkinsonmay@gmail.com>