Restructure function calls
Login support and md5 dependency