Refactor database logic