cleanups & bugfixes
porting to new factorie