improve function def's