improved interface
extracted joins into factory
extracted relation factory
query uses factories and improved model interface