fourth refactor the project about using keyword 'extern' in a proper way