more refactor fixes