removed unused methods
fixed nullpointer issues in case one of the queries failed