Added handling of true/false values for db
Refactoring code for handling join properties