Bug fix, optimize repository query, remove dependency of nette object