Refactoring and rebase

Code creating DB structure has been refactored and merged together with already released changes made by Jakub.