make some functions static to decrease code size