Refactored code

Made the constructor more DRY

Added a note in the header comments