Refactoring and Database Access Layer