some small refactoring and integ with Eco.pm