merge with archive
some refactoring
more refactoring