pulling out functions