cleanup code
Improved build regex detection
cleanup code and try to handle edge cases
add altPath and improve regex