Moderate Refactoring
A bit of refactoring