Refactor imports and messages