extracting functions from main file