Improving boundary conditions treatment