Force update secret codes + code refactoring