updated structure and cleaned functions
updated structure and cleaned functions