Refactor, test fix, readme update