Multiple planets, code cleanup