Move helper functions inside their associated task.
Added jQuery UI indexes.