issue #24 code optimization for LoginActivity