update to more robust jquery plugin design pattern