refactoring user lib stuff