finish! and code cleanup