Refactor to improve readability