further simplifications and cleanup