looks like 'switch .. case' would be better to use instead of all these 'if's