added console support; added file names cleanup