Cloned from sponge's repo