Implemented items and merged code from @tbielawa code review.