fix mixed declarations and codes
remove const qualifier
remove unused variables