cleanup — use switch
cleanup — use switch
cleanup — use switch
cleanup — remove unnessary boxing
cleanup — we don't need to use StringBuilder in this case
cleanup
don't trim empty list of subrules
we should use int here
use int instead of long