Refactor and standardization