clean up code to parse the info from stmt instead of using the object