improved $.create function