quickmagick refactoring