Use collections instead of arrays to enable stronger typing and reduce cruft
use isEmpty instead of size() == 0 for clarify