Fixes and re-factory