enhance reractor.sql