More refactoring... removed deprecated functions