Refactor changes made in fe1e16c