refactored userthread