improve init database flow