Fixed circular dependency issues