Refactored plugin to append data in DOM