Refactor, improve coverage to 75%.