refactor of defining a value as sql