Add more utility code, general APN code, reorganize for more modularity