Better code detection