refactor for better readability