Refactoring usecases and HAL resources