move some functions from bashrc to tools