remove unused variable and magic number