added source maps + refactored code