general refactor - missing some adjusts