1.Refactor Code

2.mock db