Refactor for cleaness