Refactoring, minor bug / interaction fixes