a bit of elius refactoring for clarity