FEATURE - move out db code