Located a part of #228 and improved it