break spaghetti into files
add license