Added update functionality and performance improvements