simplifications and bug fixes