refactor and add changelog