Remove flash initialization and other redundant code