clean up some attr declaration, add some comments