RESTWS-267: Some refactoring