Refactor and add support for OR operator