Attempted refactor, but current fail.