move utils to lib