some refactoring & entites relations