Little more cleanup

- Remove magic number
- Reduce size of scope matching function