some refactoring
minor fix