some code cleanings