split code & prelude to save them in local storage