Refining database access