first basic preprocessing functions