Implemented query method of Firebase factories