moved db fields and commands out