inline more functions and format some classes