Futher refactoring