Did some refactor