Refactoring - separated model
Added DB restore functionality