Major refactoring...should knows a lot better than what Pinmi should do from now on