function simplifications fixes