Code restructuring and feature additions