Some refactoring... a little better