Pass needed objects to functions