General cleanup and modernization