a bit of optimization