some light refactoring
merge