Merge pull request #4 from wick-ed/0.5.8-beta

reviewed with 0.5.8-beta7
minor refactoring to comply with pbc