Tartaros: Run cleanup function added. Re-factoring.