To be refactored.