takeout reg.function in a separate class