Code cleanup (not tested)
cleanup, location not 100% accurate