Code updates and clean-up