Refactor Codes

Refactor Codes