simplifications, add documentation