Refactored module usig promises and change module file structure