Refactor for litt ryddigere kode.