authorization refactoring
refactoring authorization code