Refactor context db table