some minor refactoring and cleanup
changed version