Move database stuff in utils directory