can be refactored