refactoring and fancybox