refactor fixes