Made stuff more object oriented.