Initial checkin of refactored code.