new duplicates removal algorithm + some handy actions in documents controller