Refactor countries app