refactoring still not usable
TODO recursive func, recursive call, read file, read field