authcode modify and thinking,use decorator or factory or other design
pattern?