Implemented updating system

Refactored Java code