more flexible code