organize util func, and err