Major refactoring of superfish