clean code to use sql server.