Use enum constant instead of a magic number
Reuse nearByInt() instead of code copy
Do not activate actions unless enough items are selected.