Nanocrystallization confined to porous matrices with and without surface functionalization effects