Structure refactor
bug fix