Solved problem 54
refactoring into helper library