use collections to avoid repeating of code