Uff, I'll refactor this.