Ported appTemplate's extras function.