Further refactoring work