refactored method factory
refactored client auth manager to use the new method factory
code style fixes
code style fixes