cleaned up and handeld resultset in a good way