format code, collapse code to functions, decrease size and increase simplicity