Code refactoring, added "object" case to tests