Closes #176 (closed)
This is the follow-up MR of this branch because the earlier one did not fix all the presented issues