Some refactors