Code cleanup. Refactored to limit includes.