Introducing read-only db view values

As suggested by Stepan. Greatly reduces code clutter, improves clarity
and code-structuring.