minimize the code