properly render axis data and some refactoring