Rewritted unit tests. Was adapted to refactored code.