trim down the code