Some refactoring of dungeons and pythons task