changes and refactor