clean up code, add a few final fields