Reorganized imports and implemented logger function