More simplifications and de-duplication of code.