global refactoring - step 1: login