Refactory localDB using class keyword