fixed compatibility with nette 2.2, refactoring
merge