format code
re-factor code