Refactor to simplify
Refactor to simplify