Added utility methods, cleaned up whitespace, added invalid helper.