DAL: Code Tidyup and hopeful memory leak fix