Some code moved to better the UX.