Refactor code

Fixes #19.
please close <a> tag :+1: