Some code modifications