refactored a bit and added the failsafe plugin for commandline building