a little refactoring and also added new predicates