Refactoring main activity

    Database does not work yet.