refactoring
several steps for way to db integration