Refactor 'clean' method