more class style, ruin global variables