huge update so it works with array source, should also work in component