first lot of changes for #117