Cleaned up some extension code