Few more simlifications and removing unused functions