Remove duplicate code from init script