Code cleaning in pebble controller