apply lint suggestions and cleanup code