refactored stuffs