Cleanup and use File.join instead of File.dirname