refactored custom sql