Remove STRING_MAXLEN and cleanup code

Change-Id: I933b69af09c8d58a71d9d82d7e13b1b893e57ec0