To be refactored to legal