Cleanups and initial implementation