restructuring engine related libs