ADD: tests for refactored functions