Actually, I'm not really sure where's the best place to put these functions.