Changed all Set<E> to Collection<E> for getting ordered list of elements