refactoring, preparing for jquery plugin page