moving a bunch around to dom and private methods