implement @kaelig suggested refactor