updated to support more usecases