Type should probably be an enum, rather than generic int.