cleaned smarty functions, contrib and events