some refactoring
minor changes