Version 0.4 updates, refactoring