require classes in functions