Some cleanup and added main header.