Improves post build

Greatly simplifies and cleans the post build script.