snap: refactoring