Code cleanup and FPS measuments added.