cleaning and refactoring of the coordinates system