a small framework based on query