refractor the codebase
