Refactor to simplify