Splited rather bigger tests into smaller cases and refactored to reduce duplication.