Adapted sql helper creation and some queries