minor refactoring and picture fix