Some refactors at #3 and #4