fix warning, slight refactor