Move some funcs for better file organization.