code refactaring and login and db colum change