refactor legacy code - mainly workroom