made some refactoring with fields