Reworked according to comments from review