Refactor to imporve readability