Some refactorng