ENH: fixes to build flow, header files refactor