Refactored preview and linted code