Improve & cleanup code.