further refactorage