a lot of updates to add flexibility