Mahor code cleanup