Minor refactoring, fix gun update