driver: clean up resource creation function