Rewrote whole core class.