refactoring to uLogin lib/*