some refactor stuff