Moved functionality to own class.