refactor db seed code