* huge refactory