[SD-851] Encapsulated business logic in preferences service.
[SD-851] Unit tests for preferences service.