Some refactoring
Removed (for now) un-used code