removed compilation errors and done some refactoring to cut datacacher
out