refactoring stuffs