Refactored project for stack file to reuse code