some refactoring
fixed typo
small cleanup