Refactored further and added moment