Fix setters and getters for shared state
Refactor Database schemas