Figarocorso/ha refactor fixes

Please, wait till @sixstone-qq agrees to merge