Refactored framework and converted queries to DynamicTable queries