cleanup code, remove redundant stuff