Minor refactor here and there.