Refactor physics and related stuff to 100 lines limit