slim down code