Removed two levels of useless refactoring, still no idea how to make it not recurse indefinitely