Refactoring bool primops