refactor: extracted X axis/scale to external function