remove unused variable and add const