Made it much more flexible