add Apache headers and update code style