Turn JS into plugin