Refractor to simplify