indexing - small refactor on server side