removed duplicate code + clean up

i will kill you geka