[fix] Moved loading code for spawn into its own method.
[fix] Removed trailing whitespaces.