Reorganized headers and source files