Refactoring and adding import method