remove most of the duplicate function

Only use 'set' a 'configure' function to define how program has to be
set and configured. Then use generic build function.