AG|ES: added a little refactoring