cleanup of alignment code