country table and code refactor