better performance
make sql query reusable