start to move child functions out of longish function
remove unused return value