Factored out some unnecessary code