This method is doing two different things, can you refactor it?