Better output and filtering when dealing with arrays