final changes to reduce complexity