refactored file for clarity